const BASE_URL = 'http://localhost:8082'
export const myRequest = (options)=>{
	return new Promise((resolve,reject)=>{
		// console.log(BASE_URL + options.url)
		uni.request({
			url:BASE_URL + options.url,
			method:options.method || 'get',
			data:options.data || {},
			success:(res)=>{
				if(res.data.status!==0){
					uni.showToast({
						title:'获取数据失败',
						icon:'fail'
					})
				}
				resolve(res)
			},
			fail:(err)=>{
				uni.showToast({
					title:'接口请求失败',
					icon:'fail'
				})
				reject(err)
			}
		})
	})
}